<script>
	import Header from "@/components/Header.vue"
	export default {
		components: {
			Header
		},
		data() {
			return {
				payType: 0,
				title: "我的邀请",
				list:[],
				myInfo:{}
			}
		},
		onLoad(options) {
			this.lists()
			this.getMyInfo();
		},
		onShareAppMessage() {
			if(this.myInfo.me_invite_code){
				return {
					title: '发布消息找到那个他/她',
					path: '/pages/index/index?id=' + this.myInfo.me_invite_code,
					imageUrl: "https://seekerxcxoss.yiyankeji.vip/Label/Share_img.png"
				}
			}else{
				return {
					title: '发布消息找到那个他/她',
					path: '/pages/index/index',
					imageUrl: "https://seekerxcxoss.yiyankeji.vip/Label/Share_img.png"
				}
			}
		},
		methods: {
			lists(){
				var that = this
				uni.request({
					url:getApp().globalData.host+'/api/My/getInviteList',
					data:{
						page:1,nums:10000
					},
					header: {
						memberid:uni.getStorageSync('member_id'),
						membertoken:uni.getStorageSync('member_token'),
					},
					success:(r) => {
						console.log(r)
						that.list = r.data.data.list
					},
				})
			},
			getMyInfo() {
			
				var that = this
				uni.request({
					url: getApp().globalData.host + '/api/My/getMyInfo',
					header: {
						memberid: uni.getStorageSync('member_id'),
						membertoken: uni.getStorageSync('member_token'),
					},
					success: (r) => {
						if(r.data.code==800){
							that.flag = 0;
							uni.showModal({
								content:'抱歉，您的账号被封禁，请联系客服'
							})
							
						}else{
							that.myInfo = r.data.data
						}
						console.log(that.myInfo)
					},
				})
			},
			
			
		}
	}
</script>
<template>
	<view class="custom-bg">

		<Header :title="title" />

		<div class="list p-30">
			<div class="bg-white flex p-25 rounded-30 mb-24" v-for="item in list" @click="go('/pages/my/invite/detail?invite_id='+item.invite_id)">
				<div class="avatar mr-23 flex-shirnk-0 w-120 h-120">
					<image :src="item.me_img" mode="aspectFill" class="w-full h-full rounded-full"></image>
				</div>
				<div>
				
					<div class="fz28 text-gray-16">被邀请人：{{item.me_nick_name}}</div>
					<div class="fz28 text-gray-16 mt-16 mb-16 flex">我的收益：{{item.sy_money}}
						<div class="bg-purple px-20 py-10 center ml-16 fz24 text-white rounded-30">查明细</div>
					</div>
					<div class="fz24 text-gray-a4">邀请时间：{{item.add_time}}</div>
				</div>
			</div>
		</div>
		<nomore v-if="list.length==0"></nomore>


	</view>


</template>



<style>
	.custom-bg {
		min-height: 100%;
	}

	.avatar-group {
		position: relative;
	}

	page {
		height: 100%;
		background-color: #F8F8F8;
	}
</style>